home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 076-100 / disk_084 / ed / doglob.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  820b  |  50 lines

  1. /*
  2.  * Copyright 1987 Brian Beattie Rights Reserved.
  3.  *
  4.  * Permission to copy and/or distribute granted under the
  5.  * following conditions:
  6.  *
  7.  * 1). No charge may be made other than resonable charges
  8.  *    for reproduction.
  9.  *
  10.  * 2). This notice must remain intact.
  11.  *
  12.  * 3). No further restrictions may be added.
  13.  *
  14.  */
  15. #include <stdio.h>
  16. #include "tools.h"
  17. #include "ed.h"
  18.  
  19. doglob()
  20. {
  21.     int    cursav, lin, stat, count;
  22.     char    *cmd;
  23.     LINE    *ptr;
  24.  
  25.     lin = 1;
  26.     count = 0;
  27.  
  28.     cmd = inptr;
  29.     while(1)
  30.     {
  31.         ptr = getptr(lin);
  32.         if(ptr->l_stat & (LGLOB|LEXCL))
  33.         {
  34.             ptr->l_stat &= ~(LGLOB|LEXCL);
  35.             cursav = curln = lin;
  36.             inptr = cmd;
  37.             if((stat = getlst()) < 0)
  38.                 return(stat);
  39.             if((stat = docmd(1)) < 0)
  40.                 return(stat);
  41.             count = 0;
  42.         } else {
  43.             count++;
  44.             lin = nextln(lin);
  45.         }
  46.         if(count > lastln)
  47.             return(0);
  48.     }
  49. }
  50.